function noDataDisplay() {
    $("#table_list").hide();
    $("#data_page").hide();
    $("#recordShow").hide();
    $("#noDataDisplay").show();
}
	
function showDataList(data) {
	$("#noDataDisplay").hide();
	$("#table_list").html(data);
	$("#startResult").text(startResult);
	$("#endResult").text(endResult);
	$("#totalCounts").text(totalCounts);
	$("#totalPages").text("共"+ " " + totalPages+ " " + "页");
	$("#pageNum").text(pageNum);
	$("#table_list").show();
	$("#data_page").show();
	$("#recordShow").show();
	$("#pageContent").show();
}

function selectPage() {
	$("#selectPage").keydown(function(event){
		if(event.keyCode == 13 || event.which == 13) {
			var inputVal = $("#selectPage").val();
			if (inputVal == "") {
				alert("请输入页数");
				return;
			}
			var reg = new RegExp("^[0-9]*$"); 
			if (!reg.test(inputVal)) {
				alert("页数必须为数字");
				return;
			}
			if (inputVal <= 0) {
				currentPage = 1;
			}
			if (inputVal < totalPages) {
				currentPage = inputVal;
			}
			if (inputVal >= totalPages) {
				currentPage = totalPages;
			}
			doSearch();
		}
	});
}

//第一页
function gotoFirstPage() {
	currentPage = 1;
	doSearch();
}

//下一页
function gotoNextPage() {
	 if (parseInt(currentPage) + 1 <= totalPages) {
			currentPage = parseInt(currentPage) + 1;
			doSearch();
	 }
}

//上一页
function gotoPrePage() {
	if (currentPage - 1 > 0) {
	 	currentPage -= 1;
	 	doSearch();
	}
}

//最后一页
function gotoLastPage() {
	currentPage = totalPages;
	doSearch();
}

function showMsg(title, text) {
	 swal({
       title: title,
       text: text
   });
}
